#pragma once
#include "Runtime/BattleFirePrefix.h"
namespace Alice
{
    class FStaticPrimitiveDrawInterface;
    class SceneInterface;
    class PrimitiveSceneInfo;
    class PrimitiveComponent;
    /**
     * Encapsulates the data which is mirrored to render a UPrimitiveComponent parallel to the game thread.
     * This is intended to be subclassed to support different primitive types.  
     */
    class PrimitiveSceneProxy
    {
    public:
        /** Whether this proxy is a static mesh. */
        uint8 bIsStaticMesh : 1;

        /** Whether this proxy is a Nanite mesh. */
        uint8 bIsNaniteMesh : 1;

        /** Whether this proxy is always visible. */
        uint8 bIsAlwaysVisible : 1;
        
        /** The scene the primitive is in. */
        SceneInterface* mScene;
        PrimitiveSceneInfo*mPrimitiveSceneInfo;
        PrimitiveSceneProxy(PrimitiveComponent*inPrimitiveComponent);
        /**
        * Returns whether this proxy should be considered a "detail mesh".
        * Detail meshes are distance culled even if distance culling is normally disabled for the view. (e.g. in editor)
        */
        virtual bool IsDetailMesh() const
        {
            return false;
        }

        /**
        * Returns whether this proxy is a Nanite mesh.
        */
        inline bool IsNaniteMesh() const
        {
            return bIsNaniteMesh;
        }

        /**
        * Returns whether this proxy is always visible.
        */
        inline bool IsAlwaysVisible() const
        {
            return bIsAlwaysVisible;
        }
        /**
         * Draws the primitive's static elements.  This is called from the rendering thread once when the scene proxy is created.
         * The static elements will only be rendered if GetViewRelevance declares static relevance.
         * @param PDI - The interface which receives the primitive elements.
         */
        virtual void DrawStaticElements(FStaticPrimitiveDrawInterface* PDI) {}
        virtual SIZE_T GetTypeHash() const = 0;
    };
    /*
     * All the necessary information for scene primitive to component feedback 
     */
    struct PrimitiveSceneInfoData
    {
        /** The primitive's scene info. */
        PrimitiveSceneProxy* SceneProxy = nullptr;
    };
}